Updated templates as per tutorial exercise to include robust tests for corner cases.