Addded bug fixes