Lot of changes and fixes ( yes I'know this kind of commits are bad :( )