Bug fix and stuff