Bugfixes modal

Fixed some bugs, introduced some delay.