Fixed minor bugs on upload