Correct bugs #2 and #4