fixed long type handling in models, added more tests