Fix target architecture issue

- Fixed the target architecture variable
- Stripped off the unused debug code