Changes from Ivalerius Fork...

Merged different changes from Ivalerius Fork