critical bug fixes!!

Just fixed some critical bug fixes. Some code I just patched for now.
Everything will be fixed till stabile 1.0 release