Fixed syntax errors

Two errors:
- Code outside of functions (moved into the __construct function)
- Missing comma