Fix silly bugs in the previous patch