Small fixes for code simplification