Fixed two errors in code