This is a known bug in version 4.0 that has been corrected for 4.0.1.
If you can't upgrade to the latest version then you will need to edit the file located at /lib/orders.php and do a search for the expression 'lastname'. The line that you want to edit begins with:
$GLOBALS['ShipFullName'] =
