Fixed Karan's bugs