Fixed inventory selling problem. Closes #39.