Upload event handling, minor bugs fixed