Tiny fixes after code optimization