Fixed a couple of bugs.

Both introduced in e7579b10e9b6b127e8341915701cb1d72ad1f6fb.