Index: trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java	(revision 8635)
+++ trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java	(revision 8636)
@@ -252,8 +252,8 @@
         // keep the expiration time between MINIMUM_EXPIRES and MAXIMUM_EXPIRES, so we will cache the tiles
         // at least for some short period of time, but not too long
-        if (ret.getExpirationTime() < MINIMUM_EXPIRES) {
+        if (ret.getExpirationTime() < now + MINIMUM_EXPIRES) {
             ret.setExpirationTime(now + MINIMUM_EXPIRES);
         }
-        if (ret.getExpirationTime() > MAXIMUM_EXPIRES) {
+        if (ret.getExpirationTime() > now + MAXIMUM_EXPIRES) {
             ret.setExpirationTime(now + MAXIMUM_EXPIRES);
         }
Index: trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8635)
+++ trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8636)
@@ -497,4 +497,8 @@
     public void hookUpMapView() {
         this.tileSource = getTileSource(info);
+        if (this.tileSource == null) {
+            throw new IllegalArgumentException(tr("Failed to create tile source"));
+        }
+
         projectionChanged(null, Main.getProjection()); // check if projection is supported
         initTileSource(this.tileSource);
@@ -858,5 +862,5 @@
         if (tile.isLoading())
             return false;
-        tileLoader.createTileLoaderJob(tile).submit();
+        tileLoader.createTileLoaderJob(tile).submit(force);
         return true;
     }
