Fixed lapp.add_type which was broken due to uninitialized table variable

The variable `types` was not initialized preventing `add_type` from
appending custom types to the variable. I also added a new test to
cover this test case in the future.