Fixed some bugs, fixed modal window