Adds missing sprintf() in some error messages
Fixes minor mistake in error message
Improves error messages: unifies messages for same error types and adds more information to some messages