Adding nice errors, some small bug fixes