Add length_cons method to facilitate arguments checking.