Fixed two bugs.