Fixed a bug in triangleBinary