Fixed nil patient record bug