Fixes:

 * Check Customer Object ID instead of Object. GetFirstItem returns empty class if nothing exists
 * Don't create order if no order items exist
 * Don't calculate tax percentage if tax amount is zero
Fix undefined offset