Updated to take account of CustomEntityBundle