Tested on OS X and Linux.