Stack now throws proper errors when a user might attempt to use it incorrectly. Added tests for these as well.