Use integers instead of booleans in sort function. Fixes #76.