Fixed existing bugs