Fixes for Refresh+Viewport, cleanup of MD5 functions