Incorporate vnp's suggestions

See: http://codereview.stackexchange.com/a/61481/52040