Issue #1272394 by Matthew Davidson, cwells and mhh86: Fixed invoking of field perm and improved code.