Fixing various issues