Fixing bugs from the previous two commits.