Move bad format exception in the correct place

Also rename 2 other exceptions