Fixes some problems