Fixed crash in master detail template