fix aliasing-violations and add some optimizations