Fix onload issues