Added tests, fixed package bug