fixed some null refrence errors and tidied up settings