OSX and MacPorts

Some changes to work better with OSX and MacPorts