Better error handling, now uses for-comprensions for 'complex' Option manipulation.