Merge konstantint's core modifications