Added test to cover 100% + fixed fatal error