Fixed bugs. Changed API. Added "get_errors" method