More fixing and cleanup