add nil to end of cons where appropriate