Fix a lot of bugs

Signed-off-by: eldr4d <nikofinas@gmail.com>