Implemented changes described on IRC

See commit descriptions for implemented features.