fixed inconsistency and added more tests