Fixed a bug and created stub tests to make it compile.