Fix some stuff and make properties window function