Fixed category bug and issue #1