Optimize Javascript loading
Final fixes