Fixes afew issues