changes which allow compilation on mac
backwards compatibility
merged in changes