Fixed the last two bugs