Merge konstantint's modifications