Better error handling and 2.0 compatibility