small changes to ensure portability