Add several tests and unified error messages (a bit)