Many issues fixed in this commit and made it working :)