Fixed a logical error in the startup function and added the missing handle parameter. Fixes #12