Fixed NPE in main()