Fixes bunch of minor issues.