Fixed generics problem.
Added config functionality, though not completely added yet.