Fixed identified bugs