Bugfixes with ready event