Platform cleanup and fixes