Implement suggestions from CodeReview.SE

at http://codereview.stackexchange.com/q/40655/29124