fixes applied from the @creativecoder fork