Added ifdef so that this builds on Mac too.
Added unit test for #413