Fixed some resources and tweaked the code a little