linux compat
fixing another dumb error
fixing one last off by 1 error