Fixed error handling in submit commands.