Fixing multiple bugs