error codes and fixes.

Signed-off-by: Miethpo <miethpomail@yahoo.co.uk>