Fixed two bugs that were in the last two commits