Added various bugfixes and features(see README)