Fix error when ~/.marks is empty, and add support for Mac